#include <iostream>

using namespace std;

class ATools {
public:
    virtual ~ATools() = default;

public:
    void compute() {
        cout << "Tools A Compute Data!" << endl;
    }
};

class BTools {
public:
    virtual ~BTools() = default;

public:
    void save() {
        cout << "Tools B Save Data!" << endl;
    }
};

class CTools {
public:
    virtual ~CTools() = default;

public:
    void log() {
        cout << "Tools C Log Save!" << endl;
    }
};

class DTools {
public:
    virtual ~DTools() = default;

public:
    void memoryAllocation() {
        cout << "Tools D Allocation Memory!" << endl;
    }
};

class Facade {
public:
    Facade() = default;

    virtual ~Facade() {
        delete aTools, bTools, cTools, dTools;
    }

private:
    ATools *aTools = new ATools();
    BTools *bTools = new BTools();
    CTools *cTools = new CTools();
    DTools *dTools = new DTools();

public:
    void methodA() {
        aTools->compute();
        bTools->save();
        cTools->log();
    }

    void methodB() {
        dTools->memoryAllocation();
        cTools->log();
    }
};

int main() {
    Facade facade;

    facade.methodA();

    cout << endl;

    facade.methodB();

    return 0;
}